import { request } from "@/utils/service"
import type * as Coaches from "./types/coaches"

/** 增 */
export function createCoachesDataApi(data: Coaches.CreateOrUpdateCoachesRequestData) {
  return request({
    url: "coach",
    method: "post",
    data
  })
}

/** 删 */
export function deleteCoachesDataApi(ids: string) {
  return request({
    url: `coach/batch?ids=${ids}`,
    method: "delete"
  })
}

// /** 改 */
export function updateCoachesDataApi(data: Coaches.CreateOrUpdateCoachesRequestData) {
  return request({
    url: "coach",
    method: "put",
    data
  })
}

/** 查 */
export function getCoachesDataApi(params: Coaches.GetCoachesRequestData) {
  return request<Coaches.GetCoachesResponseData>({
    url: "coach",
    method: "get",
    params
  })
}

/** 下拉 */
export function getCoachesListDataApi() {
  return request<Coaches.GetCoachesListResponseData>({
    url: "coach/list",
    method: "get"
  })
}

/** 排课列表 */
export function getCoachCourseListDataApi(params: Coaches.GetCoachCourseRequestData) {
  return request<Coaches.GetCoachesResponseData>({
    url: "coach/course",
    method: "get",
    params
  })
}
export function addCoachCourseListDataApi(data: Coaches.COUCoachCourseRequestData) {
  return request<Coaches.GetCoachCourseListResponseData>({
    url: "coach/course",
    method: "post",
    data
  })
}
